QSQL/ODBC: fix regression (trailing NUL)
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Thu, 27 Nov 2025 14:54:31 +0000 (15:54 +0100)
committerSylvain Beucler <beuc@debian.org>
Thu, 27 Nov 2025 14:54:31 +0000 (15:54 +0100)
commit20994a3ee8203dcbaf3646d5158d1f546acd105f
tree45f9ac5364399aa293ab4ff9d8f5e11a30a8969d
parent26433b0803c3482b25c36fdf35486719acef8820
QSQL/ODBC: fix regression (trailing NUL)

Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=9020034b3b6a3a81
Last-Update: 2023-06-30

When we fixed the callers of toSQLTCHAR() to use the result's size()
instead of the input's (which differ, if sizeof(SQLTCHAR) != 2), we
exposed callers to the append(0), which changes the size() of the
result QVLA. Callers that don't rely on NUL-termination (all?) now saw
an additional training NUL.

Fix by not NUL-terminating, and changing the only user of SQL_NTS to
use an explicit length.

Gbp-Pq: Name sql_odbc_fix_unicode_check.diff
src/plugins/sqldrivers/odbc/qsql_odbc.cpp